<?php
// $Id$

/**
 * Controller_Admin_Unions 控制器
 */
class Controller_Admin_Unions extends Controller_Abstract
{

	function actiondel()
	{
		$this->union_table = Unionsetting::meta();
		$this->delete(array('id'=>$this->_context->ids));
	}
	function actionIndex()
	{
        // 为 $this->_view 指定的值将会传递数据到视图中
		# $this->_view['text'] = 'Hello!';
	}
	
	function actionset()
	{
		$this->union_table = Unionsetting::meta();
		$this->lists();
	}
	
	function actionadd()
	{
		//设置提交地址
	$url = url($this->_context->controller_name.'/'.$this->_context->action_name);
		//创建表单对象
	$Form  = new Form_unionsadd($url);
		//创建自动处理对象
	$auto = new helper_autoinsert(Unionsetting::meta());
	$result = $auto->add($Form,'id',$_GET);
	if ($this->_context->isGET())
	{
		$this->_view['form'] = $result;
	}else
	{
		return call_user_func_array(array($this,$auto->status),$result);
	}
		
	}
}


